package club.justwill.single.persistence.support;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

/**
 * Created by luoyu on 15-12-24.
 */
@MappedSuperclass
public class BillBase extends Jpo {

    @Column(name = "user_id")
    private Long userId;

    @Column(name = "money")
    private Double money;

    @Column(name = "target_account")
    private String targetAccount;

    @Column(name = "status")
    private Integer status;

    @Column(name = "type")
    private Integer type;

    protected void copyBase(BillBase other) {
        setUserId(other.getUserId());
        setMoney(other.getMoney());
        setTargetAccunt(other.getTargetAccunt());
        setStatus(other.getStatus());
        setType(other.getType());
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        if(userId == null) {
            this.userId = 0L;
        } else {
            this.userId = userId;
        }

    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    public String getTargetAccunt() {
        return targetAccount;
    }

    public void setTargetAccunt(String targetAccunt) {
        this.targetAccount = targetAccunt;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
}
